﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 版权所有 (c) 2022   保留所有权利。
 * CLR版本：4.0.30319.42000
 * 机器名称：DESKTOP-UL84BU5
 * 公司名称：
 * 命名空间：KingerRobot.PCRBW.Biz
 * 唯一标识：1d8baea4-32d8-441d-9202-3ce9a7fd5dad
 * 文件名：SwitchData
 * 当前用户域：DESKTOP-UL84BU5
 * 
 * 创建者：zzl
 * 电子邮箱：1003590782@qq.com
 * 创建时间：2022/6/2 16:00:46
 * 版本：V1.0.0
 * 描述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：
 *
 * 版本：V1.0.1
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace KingerRobot.PCRBW.Biz;

internal static class SwitchData
{
    public static string GetLineEquipStatus(int equipStatus) => equipStatus switch
    {
        0 => "自动",
        1 => "故障",
        2 => "有载",
        3 => "备用",
        4 => "备用",
        5 => "备用",
        6 => "备用",
        7 => "备用",
        8 => "任务结束",
        9 => "请求下发任务",
        10 => "空闲可卸货",
        11 => "有货需取货",
        12 => "备用",
        13 => "备用",
        14 => "备用",
        15 => "备用",
        _ => $"其他 {equipStatus}"
    };

    public static string GetLineErrorNo(int errorNo) => errorNo switch
    {
        1 => "进胎超时",
        2 => "出胎超时",
        3 => "上升超时",
        4 => "下降超时",
        5 => "x轴变频器故障",
        6 => "y轴变频器故障",
        15 => "光电故障",
        _ => $"其他警告 {errorNo}"
    };
    public static string GetEmsEquipStatus(int equipStatus) => equipStatus switch
    {
        1 => "运行中",
        2 => "空闲中",
        3 => "故障",
        4 => "未进入自动",
        _ => $"其他Ems { equipStatus }"
    };
    public static string GetEmsSign(int sign) => sign switch
    {
        0 => "桁架运行中",
        1 => "下位可读指令",
        2 => "上位可写指令",
        _ => $"其他Ems{sign}"
    };

    public static string GetStackerStatus(int status) => status switch
    {
        0 => "手动",
        1 => "自动",
        3 => "报警",
        4 => "网络故障",
        _ => $"其他状态 {status}"
    };

    public static string GetStackerAcceptCmd(int status) => status switch
    {
        1 => "可接受指令",
        0 => "不接受指令",
        _ => $"其他状态 {status}"
    };
    public static string GetLineErrByCode(int status) => status switch
    {
        2 => "电机故障",
        3 => "光电故障",
        4 => "数据丢失",
        5 => "超高",
        _ => $"未知线体故障"
    };

    public static string GetSmallLineScannerMes(int status) => status switch
    {
        -1 => $"{status}开始位未配置",
        -2 => $"{status}车号为空",
        -3 => $"{status}车号上一次已创建任务",
        -4 => $"{status}条码为 NOREAD",
        -5 => $"{status}任务已存在",
        -6 => $"{status}空车重量已超出标准车重 CartEmptyWeightUpperLimit",
        -7 => $"{status}未找到车信息",
        -8 => $"{status}MES禁止入库 InPermit",
        -9 => $"{status}车重超出立库承重能力 MaterialSmallWeightUpperLimit",
        -10 => $"{status}大胎不允许入小胎堆垛机",
        _ => $"{status}未知异常"
    };
    public static string GetBigLineScannerMes(long status) => status switch
    {
        -1 => $"{status}开始位未配置",
        -2 => $"{status}车号为空",
        -3 => $"{status}车号上一次已创建任务",
        -4 => $"{status}条码为 NOREAD",
        -5 => $"{status}任务已创建，类型不是输送任务",
        -6 => $"{status}任务已存在",
        -7 => $"{status}空车重量已超出标准车重 CartEmptyWeightUpperLimit",
        -8 => $"{status}未找到车信息",
        -9 => $"{status}MES禁止入库 InPermit",
        -10 => $"{status}车重超出立库承重能力 MaterialBigWeightUpperLimit",
        -11 => $"{status}小胎堆垛机有空货位不允许进大胎堆垛机",
        -12 => $"{status}未找到入库路线 wcs_asrs_net_input",
        -13 => $"{status}入库输送任务创建失败",
        _ => $"{status}未知异常"
    };
}
